<?php
use yii\helpers\Html;
use doumiaoduo\layer\LayerConfirmWidget;
use doumiaoduo\layer\LayerIframeWidget;
use common\components\helpers\Fun;
LayerConfirmWidget::widget();
LayerIframeWidget::widget();
?>
<div class="yx-praise-list-box yx-praise-box yx-radius2 zx-min-height" id="toolbar" data-shelve_url="<?=\common\components\helpers\Fun::url(['goodsgroup/shelve'])?>" data-role="<?=Yii::$app->user->identity->role?>">
    <?= $this->renderFile('@app/views/layouts/toolbar.php'); ?>
    <div id="search-area" class="yx-bgf7f7f7 yx-radius5 zx-mg yx-function2 yx-pr0">
        <?= Html::beginForm(Fun::url(['goodsgroup/index']), 'get', ['enctype' => 'multipart/form-data']) ?>
        <?=\common\components\helpers\Search::dropDownList('cate_name',null,$tree,['label'=>'商品分类','promote'=>'请选择','encode'=>false,'class'=>'search diy_select_txt'])?>
        <?= \common\components\helpers\Search::textInput('goods_name', null, ['label'=>'商品名称','class' => 'search yx-width150 zx-lh24 yx-ml6']); ?>
        <?= \common\components\helpers\Search::textInput('mechanic_name', null, ['label'=>'机构别名','class' => 'search yx-input-text zx-width150 yx-ml6']); ?>
        <?= \common\components\helpers\Search::submitButton('搜索', ['id'=>'search-handle','class'=>"yx-search yx-radius2"]); ?>
        <?php Html::endForm() ?>
    </div>
  <div class="docs-main zx-mg">
      <table id="tablesaw" class="tablesaw table yx-table1 yx-table5 table-striped with-check"  data-tablesaw-mode="swipe" data-tablesaw-minimap >
       <thead>
       <tr class="yx-bgd2f6ec">
           <th><?=\Yii::t('zhtfrontend','ID');?></th>
           <th><?=\Yii::t('zhtfrontend','商品名称');?></th>
           <th><?=\Yii::t('zhtfrontend','商品编号');?></th>
           <th><?=\Yii::t('zhtfrontend','分类名称');?></th>
           <th><?=\Yii::t('zhtfrontend','品牌名称');?></th>
           <th><?=\Yii::t('zhtfrontend','机构');?></th>
           <th><?=\Yii::t('zhtfrontend','库存');?></th>
           <th><?=\Yii::t('zhtfrontend','价格');?></th>
           <th><?=\Yii::t('zhtfrontend','成本价');?></th>
           <th><?=\Yii::t('zhtfrontend','市场价');?></th>
           <th><?=\Yii::t('zhtfrontend','上下架');?></th>
           <th><?=\Yii::t('zhtfrontend','是否可购买');?></th>
           <th><?=\Yii::t('zhtfrontend','商品类型');?></th>
           <th><?=\Yii::t('zhtfrontend','创建时间');?></th>
           <th><?=\Yii::t('zhtfrontend','操作');?></th>
       </tr>
        </thead>
          <?php if($data):?>
              <?php foreach($data as $item):?>
                  <tr data-id="<?=$item['id']?>">
                      <td><?=$item['id']?></td>
                      <td><?=$item['name']?></td>
                      <td><?=$item['sn']?></td>
                      <td><?=$item['cate_name']?></td>
                      <td><?=$item['brand_name']?></td>
                      <td><?=$item['mechanic_name']?></td>
                      <td><?=$item['store']?></td>
                      <td><?=$item['price']?></td>
                      <td><?=$item['cost']?></td>
                      <td><?=$item['market_price']?></td>
                      <td><?=$item['is_shelve']?></td>
                      <td><?=$item['is_buy']?></td>
                      <td><?=$item['goods_type']?></td>
                      <td><?=$item['created_at']?></td>
                      <td><?=$item['operate']?></td>
                  </tr>
              <?php endforeach;?>
          <?php endif;?>
    </table>
      <div style="text-align: right"><?= common\components\widgets\GoPager::widget(['pagination' => $pages]) ?></div>
  </div>
</div>



